package com.nimitz.system.mapper;

import com.nimitz.system.domain.SysDirtyWater;
import com.nimitz.system.service.SysDirtyWaterService;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Mapper
public interface SysDirtyWaterMapper {
    @Select("SELECT * FROM sysDirtyWaterMapper WHERE name = #{id}")
    List<SysDirtyWater> findById();

    @Insert("INSERT INTO sysDirtyWaterMapper (name, factory_id, auditor_id, create_time, update_time) " +
            "VALUES (#{name}, #{factoryId}, #{auditorId},now(), now())")
    void add(SysDirtyWater sysDirtyWater);

    @Update("UPDATE sysDirtyWaterMapper SET name=#{name}, factory_id=#{factoryId}, auditor_id=#{auditorId}, update_time=now() WHERE id=#{id}")
    void update(SysDirtyWater sysDirtyWater);

}
